#ifndef TRAIN_H
#define TRAIN_H

#include "Arduino.h"
#include "TrainData.h"
#include "TrainListener.h"
#include "Potentiometer.h"
#include "PotentiometerListener.h"
#include "LED.h"
#include "PushButton.h"
#include "PushButtonListener.h"

class Train : public PotentiometerListener, PushButtonListener {
  public:
  Train(TrainListener* listener, TrainData trainData);  // Constructor
  /* Methodes */
  virtual void potentiometerPositionChanged(int value);
  virtual void pushButtonPositionChanged(boolean state);
  void trainCommandAccepted();
  void trainCommandAdapted();
  byte getId();
  
  private:
  /* Attributs */
  byte m_id;
  Potentiometer* m_potentiometer;
  LED* m_LED;
  PushButton* m_pushButton;
  TrainListener* m_listener;
  boolean m_lastCommandIsNullSpeed;
 
};

#endif /* TRAIN_H */
